const webpack = require('webpack')
const merge = require('webpack-merge')
const common = require('./webpack.common')

const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = merge (common, {
  mode: 'development',
  devtool:  'eval-source-map',
  devServer: {
    hot: true,
    contentBase: './dist',
    port: 3000

  },
  plugins: [
   
    new webpack.HotModuleReplacementPlugin(),
    new HtmlWebpackPlugin({
      filename: 'index.html',
      template: './src/index.html',
      inject: true
    }),
    new CopyWebpackPlugin({
      patterns: [
        {from: 'public'}
      ]
    })
  ]
})